From 5d0efa621fff90f4252108dacb8155f222145c96 Mon Sep 17 00:00:00 2001 From: Kouya Shimura Date: Wed, 15 Dec 2010 16:49:06 +0000 Subject: [PATCH] tools/hotplug/Linux: force release lock if holder process is gone (fix) 22508:57907b28e51a was unsafe for mutual exclusion. There is a case that the owner file doesn't exist yet when an atomic mkdir operation fails. Signed-off-by: Kouya Shimura Signed-off-by: Ian Jackson --- tools/hotplug/Linux/locking.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/hotplug/Linux/locking.sh b/tools/hotplug/Linux/locking.sh index 8748d95454..e233c4763a 100644 --- a/tools/hotplug/Linux/locking.sh +++ b/tools/hotplug/Linux/locking.sh @@ -63,7 +63,7 @@ _claim_lock() retries=0 else local pid=$(echo $owner | cut -d : -f 1) - if [ ! -f "/proc/$pid/status" ] + if [ -n "$pid" -a "$pid" != "unknown" -a ! -f "/proc/$pid/status" ] then _release_lock $lockdir fi -- 2.30.2